function [ new_v ] = jacobi(v, f, A)
%JACOBI Summary of this function goes here
%   Detailed explanation goes here

assert(size(A,1) == size(A,2));
assert(size(A,1) == length(f));
assert(size(A,1) == length(v));

global omega;

D = diag(diag(A),0);
C = A - D;

assert(size(A,1) == size(C,1));
assert(size(A,2) == size(C,2));
assert(size(A,1) == size(D,1));
assert(size(A,2) == size(D,2));

new_v = (1 - omega) * v + omega * inv(D) * (f - C*v);

assert(size(A,1) == length(new_v));

end

%function [ new_v ] = jacobi(v, f, k)
%global C;
%global iD;
%new_v = (1 - omega) * v + omega * iD{k} * (f - C{k}*v);

%end